<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <meta name="renderer" content="webkit">
    <meta name="format-detection" content="telephone=no"/>
    <title>最新资讯/详情</title>
    <link rel="stylesheet" href="{{asset('css/moe.css')}}"/>
    <link rel="stylesheet" href="{{asset('assets/css/scroll/demo.css')}}"/>
    <link rel="stylesheet" href="{{asset('assets/css/scroll/jquery.jscrollpane.css')}}"/>

    <link rel="stylesheet" href="{{asset('assets/css/base.css')}}"/>
    <link rel="stylesheet" href="{{asset('assets/css/common.css')}}"/>
    <link rel="stylesheet" href="{{asset('assets/css/pro-details.css')}}"/>
    <link rel="stylesheet" href="{{asset('assets/css/new.css')}}"/>
    <link rel="stylesheet" href="{{asset('assets/css/active.css')}}"/>

    <!--弹窗-->
    <link rel="stylesheet" href="{{asset('assets/css/pop-up.css')}}"/>

    <!--media-->
    <link rel="stylesheet" href="{{asset('assets/css/media/common.css')}}"/>
    <link rel="stylesheet" href="{{asset('assets/css/media/news.css')}}"/>
    <link rel="stylesheet" href="{{asset('assets/css/media/common-m.css')}}"/>
</head>
<body>
<div class="container">
    <div class="container-common clearfix">
        <div class="container-common-top clearfix">
            <div class="container-common-top-fl fl"><a class="a-href" href="{{route('index')}}">LOGO</a></div>
            <div class="container-common-top-fr fr"><img class="container-common-top-fr-img"
                                                         src="{{asset('assets/img/common/tel.png')}}"/><span
                        class="com-x1">{{$about_texts['右上角电话']}}</span></div>
        </div>
        <div class="container-common-nav"><img class="navc navc1" src="{{asset('assets/img/common/navc.png')}}"/> <img
                    class="navc hide navc2" src="{{asset('assets/img/common/nav-err.png')}}"/></div>

        <div class="pro-container pagees">
            <!--新闻资讯-->
            <div class="news-container mar-auto clearfix clearfix2">
                @foreach($news_list as $list)
                    <div class="about-new-item fl" data-id="{{$list->id}}">
                        <div class="about-new-item-d1">{{date('Y-m-d', strtotime($list->created_at))}}</div>
                        <div class="about-new-item-t1">{{$list->title}}</div>
                        <div class="about-new-item-t2">
                            @if($list->show !== null)
                                <img class="about-new-item-t2-img"
                                     src="{{Storage::disk('uploads')->url($list->show)}}"/>
                            @endif
                            <span class="t2-text">{{$list->micro}}</span>
                        </div>
                    </div>
                @endforeach
            </div>

            <!--联系我们-->
            <div class="pro-tel pro-tel-02 clearfix">

                <div class="about-tel-container-phone hide">
                    <div class="about-tel-fr ">
                        <div class="about-tel-fr-t1">{{$about_texts['公司名称']}}</div>
                        <div class="about-tel-fr-t2">{{$about_texts['公司电话']}}<span
                                    class="com-j1">{{$about_texts['公司传真']}}</span></div>
                        <div class="about-tel-fr-t2">{{$about_texts['公司地址']}}</div>
                    </div>
                    <div class="about-tel-nav-b clearfix">
                        <div class="about-tel-nav-b-fl about-tel-nav-b-fl01 fl"></div>
                        <div class="about-tel-nav-b-fl- fl">联系我们</div>
                        <div class="about-tel-nav-b-fl about-tel-nav-b-fl02 fr"></div>
                    </div>
                    <div class="about-tel-fl-01-c">
                        <div class="about-tel-fl-01-cp clearfix">
                            <div class="about-tel-input fl"><input class="inp01" id="int01" placeholder="某某某"></div>
                            <div class="about-tel-error fr gr1"><img class="about-tel-error-img"
                                                                     src="{{asset('assets/img/index/p05-01.png')}}"/><span
                                        class="com-j2"></span></div>
                        </div>
                        <div class="about-tel-fl-01-cp clearfix">
                            <div class="about-tel-input fl"><input class="inp01" id="int02" placeholder="Emial"></div>
                            <div class="about-tel-error fr gr1"><img class="about-tel-error-img"
                                                                     src="{{asset('assets/img/index/p05-01.png')}}"/><span
                                        class="com-j2"></span></div>
                        </div>
                        <div class="about-tel-fl-01-cp about-tel-fl-01-cp3 clearfix">
                            <div class="about-tel-input fl"><textarea class="inp01 inp03" id="int03"
                                                                      placeholder="内容"></textarea></div>
                            <div class="about-tel-error fr gr1"><img class="about-tel-error-img"
                                                                     src="{{asset('assets/img/index/p05-01.png')}}"/><span
                                        class="com-j2"></span></div>
                        </div>
                    </div>
                    <div class="about-tel-fl-01-t2" onclick="submit()">发送</div>
                    <div class="banquan">{{$about_texts['备案']}}<br/>
                        {{$about_texts['版权']}}
                    </div>

                </div>

                <div class="about-tel-fl  about-tel-fl-01 fl">
                    <div class="about-tel-fl-01-c">
                        <div class="about-tel-fl-01-cp clearfix">
                            <div class="about-tel-input fl"><input class="inp01" id="int01" placeholder="某某某"></div>
                            <div class="about-tel-error fr gr1"><img class="about-tel-error-img"
                                                                     src="{{asset('assets/img/index/p05-01.png')}}"/><span
                                        class="com-j2"></span></div>
                        </div>
                        <div class="about-tel-fl-01-cp clearfix">
                            <div class="about-tel-input fl"><input class="inp01" id="int02" placeholder="Emial"></div>
                            <div class="about-tel-error fr gr1"><img class="about-tel-error-img"
                                                                     src="{{asset('assets/img/index/p05-01.png')}}"/><span
                                        class="com-j2"></span></div>
                        </div>
                        <div class="about-tel-fl-01-cp about-tel-fl-01-cp3 clearfix">
                            <div class="about-tel-input fl"><textarea class="inp01 inp03" id="int03"
                                                                      placeholder="内容"></textarea></div>
                            <div class="about-tel-error fr gr1"><img class="about-tel-error-img"
                                                                     src="{{asset('assets/img/index/p05-01.png')}}"/><span
                                        class="com-j2"></span></div>
                        </div>
                    </div>
                    <div class="about-tel-fl-01-t2" onclick="submit()">发送</div>
                </div>
                <div class="about-tel-fr about-tel-fr-01 fr">
                    <div class="about-tel-fr-t1">{{$about_texts['公司名称']}}</div>
                    <div class="about-tel-fr-t2">{{$about_texts['公司电话']}}<span
                                class="com-j1">{{$about_texts['公司电话']}}</span>
                    </div>
                    <div class="about-tel-fr-t2">{{$about_texts['公司地址']}}</div>
                    <div class="about-tel-fr-t3 clearfix">
                        <div class="about-tel-fr-t3-fl fl clearfix">
                            <div class="about-tel-fr-t3-fl-t1 fl"><a href="about">关于我们</a></div>
                            <div class="about-tel-fr-t3-fl-t1 fl"><a href="#">联系我们</a></div>
                            <div class="about-tel-fr-t3-fl-t1 fl"><a href="pro">产品中心</a></div>
                            <div class="about-tel-fr-t3-fl-t1 fl"><a href="#">登录</a>/<a href="#">注册</a></div>
                            <div class="about-tel-fr-t3-fl-t1 fl"><a href="news">最新资讯</a></div>
                        </div>
                        <div class="about-tel-fr-t3-fr fr"><img class="about-tel-fr-t3-fr-img"
                                                                src="{{Storage::disk('uploads')->url($about_texts['微信二维码'])}}"/>
                            <div class="about-tel-fr-t3-fr-01"><img src="{{asset('assets/img/index/p06-02.png')}}"/>扫一扫
                                了解更多
                            </div>
                        </div>
                    </div>
                    <div class="about-tel-fr-t4">{{$about_texts['备案']}} {{$about_texts['版权']}}</div>
                </div>
            </div>


            <!--返回顶部-->
            <div class="return-top hide"><img class="return-top-img" src="{{asset('assets/img/common/top.png')}}"/>
            </div>


        </div>

    </div>
    <div class="hide-nav hide op01 z-index01">
        <div class="hide-nav-fl-title">logo</div>
        <div class="hide-navs">
            <ul class="hide-navs-ul">
                <li class="navs-li "><a href="{{route('index')}}">首页</a></li>
                <li class="navs-li"><a href="pro">产品中心</a></li>
                <li class="navs-li"><a href="about">关于我们</a></li>
                <li class="navs-li navs-li-active"><a href="news">最新资讯</a></li>
                <li class="navs-li lianxi"><a href="#">联系我们</a></li>
                <li class="navs-li"><a href="#">登录</a>/<a href="#">注册</a></li>
            </ul>
        </div>
    </div>

    <div class="pc-hide-nav ">
        <ul class="pc-hide-navs-ul">
            <li class="pc-navs-li "><a href="{{route('index')}}"><img class="pc-navs-li-img"
                                                                      src="{{asset('assets/img/common/nav-index.png')}}"/>首页</a>
            </li>
            <li class="pc-navs-li"><a href="pro">产品中心</a></li>
            <li class="pc-navs-li "><a href="about">关于我们</a></li>
            <li class="pc-navs-li pc-navs-li-active"><a href="news">最新资讯</a></li>
            <li class="pc-navs-li lianxi"><a href="#">联系我们</a></li>
            <li class="pc-navs-li"><a href="">登录</a>/<a href="#">注册</a></li>
        </ul>
    </div>


    <div class="zz hide"></div>


    <!--弹出框-->
    <div class="zz6 hide"></div>

    <div class="tc-pro">
        <div class="zz6-err"><img src="{{asset('assets/img/pro/pro-d1-err.png')}}"/></div>
        <div class="tc-pro-container">
            <div class="news-title"></div>
            <div class="news-t2"></div>
            <div class="new-details-container">
                <div class="spinner">
                    <div class="rect1"></div>
                    <div class="rect2"></div>
                    <div class="rect3"></div>
                    <div class="rect4"></div>
                    <div class="rect5"></div>
                </div>
            </div>
            <div class="container-close">【关闭】</div>
        </div>

    </div>


</div>

<script src="{{asset('assets/js/jquery.min.js')}}"></script>
<script src="{{asset('assets/js/font-size.js')}}"></script>
<script src="{{asset('assets/js/scroll/jquery.mousewheel.js')}}"></script>
<script src="{{asset('assets/js/scroll/jquery.jscrollpane.js')}}"></script>
<script src="{{asset('assets/js/common.js')}}"></script>


<script>
    $(document).on("click", ".about-new-item", function () {
        let data_id = $(this).data('id');
        $.ajax({
            url: './news/' + data_id,
            type: 'get',
            async: true,
            timeOut: 50000,
            dataType: 'json',
            data: $('form').serialize(),
            beforeSend: function () {
                //函数体，数据发送前执行。
                $('.news-title').html('');
                $('.news-t2').html('');
                $('.new-details-container').html('<div class="spinner"><div class="rect1"></div><div class="rect2"></div><div class="rect3"></div><div class="rect4"></div><div class="rect5"></div></div>');
                $(".zz6").removeClass("hide");
                $(".tc-pro").addClass("tc-pro-add");
            },
            success: function (data, textStatus, jqHXR) {
                //函数体，数据发送成功回调
                console.log(data);
                $('.news-title').html(data[0]['title']);
                let creat_timestamp = data[0]['created_at'];
                creat_timestamp = creat_timestamp.substring(0, 19);
                creat_timestamp = creat_timestamp.replace(/-/g, '/');
                let time_date = new Date(creat_timestamp).getTime();
                let d = new Date(time_date); //根据时间戳生成的时间对象
                let post_date = (d.getFullYear()) + "-" +
                    (d.getMonth() + 1) + "-" +
                    (d.getDate());
                $('.news-t2').html(post_date);
                $('.new-details-container').html(data[0]['content']);
            },
            error: function (xhr, textStatus) {
                //函数体，数据发送失败回调
                console.log(xhr + textStatus);
            },
        });
        return false;
    });
    $(".zz6-err").click(function () {
        $(".zz6").addClass("hide");
        $(".tc-pro").removeClass("tc-pro-add")
    });
    $(".container-close").click(function () {
        $(".zz6").addClass("hide");
        $(".tc-pro").removeClass("tc-pro-add")
    });


    $(function () {
        var content_arr = [];//定义一个空数组
        $('.t2-text').each(function () {//遍历box内容
            var content = $.trim($(this).text());//去掉前后文空格
            content_arr.push(content);//内容放进数组
        })
        for (var i = 0; i < content_arr.length; i++) {//遍历循环数组
            if (content_arr[i].length >= 90) {//如果数组长度（也就是文本长度）大于等于50（数字可自己定义）
                content = content_arr[i].substr(0, 90) + '...';//添加省略号并放进box文字内容后面
                $(".t2-text").eq(i).text(content);
            } else {
                content = content_arr[i];
                $(".t2-text").eq(i).text(content);
            }
        }
    })

    //
    // $(function()
    // {
    //     $('.pagees').jScrollPane();
    // });
    //


</script>
</body>
</html>
